package test_package;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 27.11.13
 * Time: 11:51
 * To change this template use File | Settings | File Templates.
 */
public class buxfer_com_pageObject_account_menu_test {
    private WebDriver driver;
    private String login="destinygenerated@gmail.com";
    private String password="123123";

    @BeforeTest
    public  void before(){
        System.setProperty("webdriver.chrome.driver", "C:\\chromedriver\\chromedriver.exe");
        driver = WebDriverFactory.getDriver(DesiredCapabilities.firefox()); //DesiredCapabilities.browser - change name to set another
        driver.manage().window().maximize();
        driver.get("https://www.buxfer.com");
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    }

    @AfterTest
    public void after(){
        driver.manage().deleteAllCookies();
        driver.quit();
    }

    @Test
    public void account_menu_test (){
        buxfer_com_HomePage homePage = new buxfer_com_HomePage(driver);

        buxfer_com_AccountMainPage accountMainPage = homePage.login(login,password);
        accountMainPage.closePopUp();
        accountMainPage.assertProfileMenuItem();
        accountMainPage.assertPasswordMenuItem();
        accountMainPage.assertMembershipMenuItem();
        accountMainPage.assertAlertsMenuItem();
        accountMainPage.assertCurrencyMenuItem();
        accountMainPage.assertTranslateMenuItem();
        accountMainPage.assertRulesMenuItem();
        accountMainPage.assertDownloadMenuItem();
        accountMainPage.assertLogoutMenuItem();
    }


}
